package com.frame.server.order.mvc.web;

import com.frame.auth.resource.security.annotation.AuthExcludeRequest;
import com.frame.auth.resource.security.util.SecurityUtils;
import com.frame.common.tools.pojo.OrderVO;
import com.frame.common.tools.result.ServiceResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther zhangwj
 * @date 2021/3/10 下午3:52
 */
@RestController
@RequestMapping(value = "order")
public class OrderController {

    @AuthExcludeRequest
    @GetMapping(value = "get")
    public ServiceResult<OrderVO> getOrder() {
        OrderVO orderVO = new OrderVO();
        orderVO.setOrderNo("123");
        orderVO.setOrderDesc("订单详情");
        orderVO.setOrderTime(System.currentTimeMillis());
        return ServiceResult.getSuccessResult(orderVO);
    }

    @GetMapping(value = "user")
    public ServiceResult<Object> getUser() {
        return ServiceResult.getSuccessResult(SecurityUtils.getUser());
    }
}
